-- Selector de fraccion

library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.std_logic_arith.all;

entity selector is
port(a,b: in std_logic_vector(7 downto 0);
     sel: in std_logic;
     menor_exp,mayor_exp: out std_logic_vector(7 downto 0));
end selector;

--sel = 0, significa que a es el maximo
--      1, significa que a es el minimo


architecture behavior of selector is
begin
process(a,b,sel)
begin
if(sel = '0') then
   mayor_exp <= a;
   menor_exp <= b;
else
   mayor_exp <= b;
   menor_exp <= a;
end if;
end process;
end behavior;